from pyspark.context import SparkContext, SparkConf
from pyspark.sql import HiveContext

sparkconf = SparkConf().setAppName("liz_pred").set("spark.ui.showConsoleProgress", "false")
sc = SparkContext(conf=sparkconf)
spark = HiveContext(sc)


spark.sql("use liz")
df = spark.sql("select * from liz.0622_app_all_sd_qd1")
A = df.toPandas()
import os
os.system('mkdir -p /home/liz/tmp')
A.to_excel('/home/liz/tmp/aa.xlsx', index=False)